home *** CD-ROM | disk | FTP | other *** search
- @echo off
- echo off
- rem (C) Copyright 1993, Ad Infinitum Programs, all rights reserved
-
- rem U2_EXARC.BAT accepts a single parameter: an archive file. It
- rem decompresses all files (including hidden ones, etc.) of this archive
- rem completely into the current directory. If nothing goes wrong, the files
- rem U$~CHK1 and U$~CHK2 are created by this batch file. UC tests for the
- rem presence of those files.
-
- rem 1. ARC
- rem 2. PK(X)ARC
- rem 3. PAK
-
- rem *** ARC ***
-
- rem Add file to archive
-
- echo check > u$~chk1
- arc a %1 u$~chk1
- del u$~chk1
-
- rem Expand archive
-
- arc xzw %1 *.*/h/a
-
- rem Test for correct expansion
-
- if errorlevel 1 goto error
- if not exist u$~chk1 goto retry1
- goto ok
-
-
- :retry1
- rem *** PK(X)ARC ***
-
- rem Add file to archive
-
- echo check > u$~chk1
- pkarc a %1 u$~chk1
- del u$~chk1
-
- rem Expand archive
-
- pkxarc %1 *.*
-
- rem Test for correct expansion
-
- if errorlevel 1 goto error
- if not exist u$~chk1 goto retry2
- goto ok
-
-
- :retry2
- rem Handle unlikely case of pkarc being present and pkxarc not
-
- pkarc d %1 u$~chk1
-
- rem *** PAK ***
-
- rem Add file to archive
-
- echo check > u$~chk1
- pak a %1 u$~chk1
- del u$~chk1
-
- rem Expand archive
-
- pak e %1
-
- rem Test for correct expansion
-
- if errorlevel 1 goto error
- if not exist u$~chk1 goto error
- goto ok
-
-
- :error
- rem *** Error handling ***
-
- if exist u$~chk1 del u$~chk1
- if exist u$~chk2 del u$~chk2
- goto end
-
-
- :ok
- rem *** Expansion was successfull ***
-
- rem Call 'extra' file, allowing e.g. addition of banners
-
- command /cu2_xtra
-
- rem Create second check file to notify complete success to UC
-
- echo check > u$~chk2
-
-
- :end
- rem *** End of batchfile ***
-